home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 2010 April
/
PCWorld0410.iso
/
hity wydania
/
Ubuntu 9.10 PL
/
karmelkowy-koliberek-desktop-9.10-i386-PL.iso
/
casper
/
filesystem.squashfs
/
usr
/
share
/
jockey
/
handlers
/
b43.py
next >
Wrap
Text File
|
2009-10-25
|
2KB
|
60 lines
# (c) 2008 Canonical Ltd.
# Author: Martin Pitt <martin.pitt@ubuntu.com>
# License: GPL v2 or later
import re, os.path, logging, subprocess
from glob import glob
from jockey.oslib import OSLib
from jockey.handlers import KernelModuleHandler
class B43Handler(KernelModuleHandler):
'''Handler for Broadcom Wifi chipsets which use the b43 module and
b43-fwcutter.'''
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'b43')
self.package = 'b43-fwcutter'
def enabled(self):
'''Return if the handler is enabled.
'Enabled' means that the user agreed to use this driver if it is
applicable.
'''
return KernelModuleHandler.enabled(self) and \
len(glob('/lib/firmware/b43/*.fw')) > 0
def used(self):
'''Return if the handler is currently in use.'''
return KernelModuleHandler.used(self) and \
len(glob('/lib/firmware/b43/*.fw')) > 0
def id(self):
'''Return an unique identifier of the handler.'''
i = 'firmware:' + self.module
if self.driver_vendor:
i += ':' + self.driver_vendor.replace(' ', '_')
return i
def enable(self):
'''Remove blacklist produced by BroadcomWLHandler.'''
if (OSLib.inst.package_installed('bcmwl-kernel-source')):
self.backend.remove_package('bcmwl-kernel-source')
subprocess.call(['/sbin/rmmod', 'wl'])
KernelModuleHandler.enable(self)
if os.path.exists('/usr/share/b43-fwcutter/install_bcm43xx_firmware.sh'):
subprocess.call(['/usr/share/b43-fwcutter/install_bcm43xx_firmware.sh'])
class B43LegacyHandler(B43Handler):
'''Handler for Broadcom Wifi chipsets which use the b43legacy module and
b43-fwcutter.'''
def __init__(self, ui):
KernelModuleHandler.__init__(self, ui, 'b43legacy')
self.package = 'b43-fwcutter'